package com.cyx.common.message.config;

import com.netease.nim.server.sdk.core.BizName;
import com.netease.nim.server.sdk.core.YunxinApiHttpClient;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class NetEaseSmsConfig {

    @Value("${sms.netease.accessKeyId}")
    private String accessKeyId;

    @Value("${sms.netease.accessKeySecret}")
    private String accessKeySecret;

    @Value("sms.netease.endpoint")
    private String endpoint;

    @Bean("neteaseClient")
    public YunxinApiHttpClient client() {
        return new YunxinApiHttpClient.Builder(BizName.SMS, accessKeyId, accessKeySecret).build();
    };
}
